package org.youyun56.gpsserver.command.console;

public class SocketCommand {

    private Command command;// 访问的参数值
    private String host;// 访问的服务器地址
    private int port;// 端口
    private String regex;
    private String commandLine;

    public SocketCommand(String command) {
        this.commandLine = command;
    }

    public SocketCommand(String host, int port, String command) {
        this.host = host;
        this.port = port;
        this.commandLine = command;
    }

    @Override
    public int hashCode() {
        if (this.command != null) {
            return this.command.hashCode();
        }
        return "".hashCode();
    }

    @Override
    public String toString() {
        return this.commandLine;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public String getHost() {
        return host;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getPort() {
        return port;
    }

    public void setRegex(String regex) {
        this.regex = regex;
    }

    public String getRegex() {
        return regex;
    }

    public Command getCommand() {
        return command;
    }

    public void setCommand(Command command) {
        this.command = command;
    }

    public String getCommandLine() {
        return commandLine;
    }

    public void setCommandLine(String commandLine) {
        this.commandLine = commandLine;
    }

}
